//
//  UIImagePickerController+YCExtension.h
//  YCPublicDemo
//
//  Created by 董知樾 on 2017/5/23.
//  Copyright © 2017年 xinhuanwangluo. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface UIImagePickerController (YCExtension)


/**
 从相册或者相机获取图片
 
 @param sourceType sourceType
 @param complate 回调，当picker.allowsEditing == YES 时，回调中的iamge为编辑后的image
 @return UIImagePickerController
 */
+ (instancetype)pickImageForm:(UIImagePickerControllerSourceType)sourceType complate:(void (^)(UIImage *image))complate;


/**
 拍照，并保存到相册

 @param save 是否保存到手机相册
 @param complate 回调
 @return UIImagePickerController
 */
+ (instancetype)takePhotoAndSaveToAlbum:(BOOL)save complate:(void (^)(UIImage *image))complate;


/**
 录制视频并保存到本地相册

 @param complate 回调，错误信息和路径
 @return UIImagePickerController
 */
+ (instancetype)recordVideoAndSaveToAlbumComplate:(void (^)(NSError *error, NSString *videoPath))complate;

@end
